﻿
using UnityEngine;
namespace Gameplay.CharacterFramework
{
    public class Sensor:CoreComponent
    {
        [SerializeField] private Transform _groundSensor;
        [SerializeField] private float _groundDistance;
        [SerializeField] private LayerMask _groundMask;

        public bool IsGrounded => Physics.OverlapSphere(_groundSensor.position, _groundDistance, _groundMask).Length > 0;

        private void OnDrawGizmos()
        {
            Gizmos.DrawWireSphere(_groundSensor.position, _groundDistance);
        }
    }
}
